import React, { useState } from 'react';
import { Modal, Button } from 'antd';
import Xiang from './xiang'
import Del from './del'
import Ji from './ji'
import Tiao from './tiao'
// 教室管理的内容
import ClassDetail from './classDetail'
import ClassLook from './classLook'
import ClassCompile from './classCompile'
import CreateaClassroom from './CreateaClassroom'
import CreateClassBan from './createClassBan'
import Pay from './pay'
import Money from './money'
export default function Alert(props) {
  // console.log(props);
  let { alertName, width, alertFlag, close, con ,fen,setok} = props
  const [confirmLoading, setConfirmLoading] = useState(false);
  const handleOk = () => {
    setConfirmLoading(true);
    setTimeout(() => {
      close()
      setConfirmLoading(false);
    }, 2000);
  };
  const handleCancel = () => {
    close()
  };

  return (
    <div>
      <Modal
        title={alertName}
        visible={alertFlag}
        onOk={handleOk}
        onCancel={handleCancel}
        confirmLoading={confirmLoading}
        width={width}
        keyboard={true}
        footer={null}
        // centered={true}
        maskClosable={false}
      >
        <div className="alertCon">
           {
              alertName=="删除"?<Del close={close}  setok={setok} xcon={con} fen={fen}></Del>:null
            }
            {
              alertName=="积分详情"?<Ji close={close} xcon={con}></Ji>:null
            }
             {
              alertName=="调整"?<Tiao close={close} xcon={con}></Tiao>:null
            }
          {
            alertName == "详情" ? <Xiang xcon={con}></Xiang> : null
          }     
          {/* 教室管理的明细 */}
          {
            alertName === "明细" ? <ClassDetail close={close} xcon={con}></ClassDetail> : null
          }
          {/* 教室管理的查看 */}
          {
            alertName === "查看" ? <ClassLook close={close} xcon={con}></ClassLook> : null
          }
          {/* 教室管理的编辑 */}
          {
            alertName === "编辑" ? <ClassCompile close={close} xcon={con}></ClassCompile> : null
          }
          {
            alertName=="缴费明细"?<Money  close={close} xcon={con}></Money>:null
          }
          {
            alertName==='缴费'?<Pay setok={setok} close={close} xcon={con}></Pay>:null
          }
          {/* 教室管理的点击创建教室 */}
          {
            alertName === "创建教室" ? <CreateaClassroom close={close} xcon={con}></CreateaClassroom> : null
          }
          {/* 班级管理  创建班级 */}
          {
            alertName === "创建班级" ? <CreateClassBan close={close} xcon={con}></CreateClassBan> : null
          }
        </div>
      </Modal>
    </div>
  )
}